/*
 * FactoryFilter.h
 *
 *  Created on: Nov 16, 2008
 *      Author: Ryan
 */

#ifndef FACTORYFILTER_H_
#define FACTORYFILTER_H__H_

#include "../../../OOInterface/Interfaces/UnitVisitor.h"

class FactoryFilter: public FilterVisitor
{
public:
	FactoryFilter(): _builder(false), _building(false) {}
	virtual ~FactoryFilter() {}

	//Methods specified by UnitVisitor Interface:
	virtual void visitUnit( const OOInterface::Unit& u ){}

	virtual void visitAirAspect( const OOInterface::AirAspect& a ){}
	virtual void visitLandAspect( const OOInterface::LandAspect& a ){}
	virtual void visitWaterAspect( const OOInterface::WaterAspect& a ){}

	virtual void visitBuilderAspect( const OOInterface::BuilderAspect& a ) { _builder = true; }
	virtual void visitBuildingAspect( const OOInterface::BuildingAspect& a ) { _building = true; }
	virtual void visitTransportAspect( const OOInterface::TransportAspect& a ){}

	virtual void visitReclaimableAspect( const OOInterface::ReclaimableAspect& a ){}
	virtual void visitResourceExtractorAspect( const OOInterface::ResourceExtractorAspect& a ) {}

	virtual bool isFiltered() { return !isFactory(); }
	virtual void reset() { _builder = false; _building = false; }

	bool isFactory() { return _builder && _building; }


private:
	bool _builder;
	bool _building;
};

#endif /* FACTORYFILTER_H__H_ */
